import moment from "moment/moment";

let now = moment();

// 当天最后时间

export function endDate() {
    return now.endOf('day').toDate();
}

//前一个月的当天时间
export function startDate() {
    let date = now.startOf('day').toDate();
    return new Date(date.setMonth(date.getMonth() - 1));
}

//年第一天
export function startYearDate(time) {
    return moment(time).startOf('year').toDate();
}

//年最后一天
export function endYearDate(time) {
    return moment(time).endOf('year').toDate();
}

export function endMonthDate(time) {
    return new Date(time.setMonth(time.getMonth() + 1))
}

